package pri.syl.xiaowu.websocket.netty.server.thread.execution;

import  pri.syl.xiaowu.websocket.netty.server.init.WebsocketServerInit;
import  pri.syl.xiaowu.websocket.netty.server.thread.AbstractWebsocketServerInitThread;
import lombok.extern.slf4j.Slf4j;

/**
 * @Author YunLong
 * @Date 2021/7/18 19:24
 * @Description websocket初始化执行器
 **/
@Slf4j
public class WebsocketServerInitThreadExecution extends AbstractWebsocketServerInitThread {
    public WebsocketServerInitThreadExecution(String url, int websocketMaxFramePayloadLength, int websocketReadTimeoutMilli) {
        super(url, websocketMaxFramePayloadLength, websocketReadTimeoutMilli);
    }


    @Override
    protected void init(String url, int websocketMaxFramePayloadLength, int websocketReadTimeoutMilli) {
        try {
            new WebsocketServerInit(url, websocketMaxFramePayloadLength, websocketReadTimeoutMilli).init();
        } catch (InterruptedException e) {
            log.error("WebsocketServerInit Error", e);
            Thread.currentThread().interrupt();
        }
    }
}
